package com.yintao.ytframe.base.design.factory.dest;

import com.yintao.ytframe.base.design.factory.dest.impl.AiqiyAwardServiceImpl;
import com.yintao.ytframe.base.design.factory.dest.impl.CouponAwardServiceImpl;
import com.yintao.ytframe.base.design.factory.dest.impl.GoodsAwardServiceImpl;
import com.yintao.ytframe.base.design.factory.normal.PrizeService;

/**
 * @Description
 * @Author yintao12
 * @Date 2021/1/4 20:25
 * @Doc
 **/
public class PrizeFactory {

    //1 优惠券  2 实物  3爱奇艺兑换卡
    public IAwardService newPrizeService(Integer awardType) throws Exception {
        if (null == awardType) {
            throw new Exception("awardType error");
        }
        if (1 == awardType) {
            return new CouponAwardServiceImpl();
        } else if (2 == awardType) {
            return new GoodsAwardServiceImpl();
        } else if (3 == awardType) {
            return new AiqiyAwardServiceImpl();
        }
        throw new Exception("awardType error");
    }
}
